const API = require('../../pages/api/index')
const {
  typeJson
} = require('../../utils/typejson')
let prolist = wx.getStorageSync('prolist') == '' ? wx.getStorageSync('prolist') : JSON.parse(wx.getStorageSync('prolist'))







Page({

  /**
   * 页面的初始数据
   */
  data: {
    pulldown: "",
    pullup: 2,
    addButton: true,
    Refresh: false,
    prolist: wx.getStorageSync('prolist') == '' ? wx.getStorageSync('prolist') : JSON.parse(wx.getStorageSync('prolist')),
    slide: {
      slideButton: {
        text: '编辑',
        extClass: 'test',
          src: '/page/weui/cell/icon_star.svg', // icon的路径
      },
      formConfig: [
        {
          label: '时间',
          prop: 'confirmTime',
          type: "dateTime"
  
        },
        {
          label: '地点',
          prop: 'place',
        },
  
        {
          label: '班组',
          prop: 'orgName',
          hidden: 'edit',
        },
        {
          label: '班组',
          prop: 'classGroup',
          type: 'multiDropDown',
          required: true,
          hidden: 'look',
          net: {
            url: '/app/siteMeeting/getDepartList',
            method: 'post',
            data: {
              mineId: true,
  
            },
            key: 'id',
            value: 'orgName'
          }
        },
  
  
  
        {
          label: '班组长',
          prop: 'classUser',
          hidden: 'edit',
        },
        {
          label: '班组长',
          prop: 'classManId',
          type: 'multiDropDown',
          required: true,
          hidden: 'look',
          net: {
            url: '/app/memberinfo/getList',
            method: 'post',
            data: {
              mineId: true,
  
            },
            key: 'memberId',
            value: 'nickName'
          }
        },
        {
          label: '安全员',
          prop: 'safeUser',
          hidden: 'edit',
        },
        {
          label: '安全员',
          prop: 'safeManId',
          type: 'multiDropDown',
          required: true,
          hidden: 'look',
          net: {
            url: '/app/memberinfo/getList',
            method: 'post',
            data: {
              mineId: true,
  
            },
            key: 'memberId',
            value: 'nickName'
          }
        },
  
        {
          label: '跟班领导',
          prop: 'classLeaderUser',
          hidden: 'edit',
        },
        {
          label: '跟班领导',
          prop: 'classLeaderId',
          type: 'multiDropDown',
          required: true,
          hidden: 'look',
          net: {
            url: '/app/memberinfo/getList',
            method: 'post',
            data: {
              mineId: true,
  
            },
            key: 'memberId',
            value: 'nickName'
          }
        },
        {
          label: '安全出口是否通畅',
          prop: 'isSmooth',
          checked: 0,
          type: 'boxs',
  
        },
        {
          label: '安全标识是否完善',
          prop: 'isComplete',
          checked: 0,
          type: 'boxs',
  
        },
        {
          label: '支护或围岩是否完好',
          prop: 'isGround',
          checked: 0,
          type: 'boxs',
  
  
        },
        {
          label: '采高采宽矿柱是否符合设计参数',
          prop: 'isDesign',
          checked: 0,
          type: 'boxsd',
  
        },
        {
          label: '是否有片帮，掉顶，透水征兆或现象',
          prop: 'isBad',
          checked: 0,
          type: 'boxs',
  
        },
        {
          label: '通风时间和空气质量是否符合要求',
          prop: 'isAir',
          checked: 0,
          type: 'boxsd',
  
        },
        {
          label: '掘进机械急停闭锁装置是否灵敏可靠',
          prop: 'isLock',
          checked: 0,
          type: 'boxs',
  
        },
        {
          label: '通讯系统是否畅通',
          prop: 'isCommunite',
          checked: 0,
          type: 'boxs',
  
        },
        {
          label: '监测，监控设施安设位置是否符合规定',
          prop: 'isLocation',
          checked: 0,
          type: 'boxsd',
  
        },
        {
          label: '压风自救，供水施救系统是否符合要求',
          prop: 'isSystem',
          checked: 0,
          type: 'boxsd',
  
        },
        {
          label: '通风设施安设位置是否符合规定',
          prop: 'isWind',
          checked: 0,
          type: 'boxsd',
  
        },
        {
          label: '安全员签名',
          prop: 'safeMan',
          type: 'canvas',
        },
      ]},

    listConfig: [{
        label: '班组',
        prop: 'orgName'
      },

      {
        label: '时间',
        prop: 'confirmTime',

      }
    ],


    formConfig: [


      {
        label: '时间',
        prop: 'confirmTime',
        type: "dateTime",
       

      },
      {
        label: '地点',
        prop: 'place',
      },

      {
        label: '班组',
        prop: 'orgName',
        hidden: 'edit',
      },
      {
        label: '班组',
        prop: 'classGroup',
        type: 'multiDropDown',
       
        required: true,
        hidden: 'look',
        net: {
          url: '/app/siteMeeting/getDepartList',
          method: 'post',
          data: {
            mineId: true,

          },
          key: 'id',
          value: 'orgName'
        }
      },



      {
        label: '班组长',
        prop: 'classUser',
        hidden: 'edit',
      },
      {
        label: '班组长',
        prop: 'classManId',
        tag:"userid",
        type: 'multiDropDown', 
        required: true,
        hidden: 'look',
        net: {
          url: '/app/memberinfo/getList',
          method: 'post',
          data: {
            mineId: true,

          },
          key: 'memberId',
          value: 'nickName'
        }
      },
      {
        label: '安全员',
        prop: 'safeUser',
        hidden: 'edit',
      },
      {
        label: '安全员',
        prop: 'safeManId',
        type: 'multiDropDown',
        required: true,
        hidden: 'look',
        net: {
          url: '/app/memberinfo/getList',
          method: 'post',
          data: {
            mineId: true,

          },
          key: 'memberId',
          value: 'nickName'
        }
      },

      {
        label: '跟班领导',
        prop: 'classLeaderUser',
        hidden: 'edit',
      },
      {
        label: '跟班领导',
        prop: 'classLeaderId',
        type: 'multiDropDown',
        required: true,
        hidden: 'look',
        net: {
          url: '/app/memberinfo/getList',
          method: 'post',
          data: {
            mineId: true,

          },
          key: 'memberId',
          value: 'nickName'
        }
      },
      {
        label: '安全出口是否通畅',
        prop: 'isSmooth',
        checked: 0,
        type: 'boxs',

      },
      {
        label: '安全标识是否完善',
        prop: 'isComplete',
        checked: 0,
        type: 'boxs',

      },
      {
        label: '支护或围岩是否完好',
        prop: 'isGround',
        checked: 0,
        type: 'boxs',


      },
      {
        label: '采高采宽矿柱是否符合设计参数',
        prop: 'isDesign',
        checked: 0,
        type: 'boxsd',

      },
      {
        label: '是否有片帮，掉顶，透水征兆或现象',
        prop: 'isBad',
        checked: 0,
        type: 'boxs',

      },
      {
        label: '通风时间和空气质量是否符合要求',
        prop: 'isAir',
        checked: 0,
        type: 'boxsd',

      },
      {
        label: '掘进机械急停闭锁装置是否灵敏可靠',
        prop: 'isLock',
        checked: 0,
        type: 'boxs',

      },
      {
        label: '通讯系统是否畅通',
        prop: 'isCommunite',
        checked: 0,
        type: 'boxs',

      },
      {
        label: '监测，监控设施安设位置是否符合规定',
        prop: 'isLocation',
        checked: 0,
        type: 'boxsd',

      },
      {
        label: '压风自救，供水施救系统是否符合要求',
        prop: 'isSystem',
        checked: 0,
        type: 'boxsd',

      },
      {
        label: '通风设施安设位置是否符合规定',
        prop: 'isWind',
        checked: 0,
        type: 'boxsd',

      },
      {
        label: '班组长签名',
        prop: 'classMan',
        type: 'canvas',
      },
     
      // {
      //   label: '是否可以开工',
      //   prop: 'isOpen',
      //   jsonType: typeJson.stream,
      //  type: 'boxs',
      // },
      // {
      //   label: '无法开工原因',
      //   prop: 'reason',
      // },
      // {
      //   label: '未达到开工条件，暂缓开工',
      //   prop: 'isDely',
      // },
      // {
      //   label: '带班领导签名',
      //   prop: 'classLeader',
      // },
      // {
      //   label: '带班领导签名时间',
      //   prop: 'classLeaderTime',
      //   type:"dateTime"
      // }, 
      // {
      //   label: '确认状态',
      //   prop: 'confirmStatus',
      //   jsonType: typeJson.hole,
      //  type: 'boxs',

      // },
      // {
      //   label: '带班领导审批状态',
      //   prop: 'leaderConfirm',
      //   jsonType: typeJson.hole,
      //  type: 'boxs',

      // }




    ],


    net: {

      select: {
        url: `/app/lineConfirm/getSafeList`,
        method: 'post',
        data: {
          mineId: true,


        }
      },
      delete: {
        url: '/app/siteMeeting/delete',
        method: 'post',
        data: {

        }
      },
      insert: {
        url: '/app/lineConfirm/edit',
        method: 'post',
        data: {
          mineId: true,
          classManId:"userid"

        }
      },
      update: {
        url: '/app/lineConfirm/edit',
        method: 'post',
        data: {
          classLeaderId:"userid"
        }
      }
    },
    showCom: true
  },




  /**
   * 生命周期函数--监听页面加载
   */


  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {


    this.setData({
      showCom: false
    })

    this.setData({
      showCom: true
    })
  },



  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
    wx.showLoading({
      title: '刷新中...',
    })
    this.setData({
      Refresh: true
    })
    wx.hideLoading();
    wx.stopPullDownRefresh()
    this.setData({
      Refresh: false
    })
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
    this.setData({
      pullup: this.data.pullup + 1
    })
  },


  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})